all:testPerf.exe testCorrectness.exe testFinal.exe testHybridPerf.exe

CXX=g++
CXXFLAGS=-g -O3 -fopenmp -funroll-loops
#CXX=icc #g++44
#CXXFLAGS=-g -fast -openmp -unroll #-O3 -fopenmp
RM=/bin/rm -rf

testSRC= test.c
testSRCO= ${testSRC:.c=.o}

perfSRC= testPerf.c seqScan.c tweakedScan.c tweakedScanBitOps.c hybridScan.c hybridScan2.c
perfSRCO= ${perfSRC:.c=.o}

perfHSRC= testHybridPerf.c seqScan.c tweakedScan.c tweakedScanBitOps.c hybridScan.c hybridScan2.c
perfHSRCO= ${perfHSRC:.c=.o}

SRC= testFinal.c seqScan.c tweakedScan.c tweakedScanBitOps.c hybridScan.c hybridScan2.c
SRCO= ${SRC:.c=.o}

correctSRC= testCorrectness.c seqScan.c tweakedScan.c tweakedScanBitOps.c hybridScan.c hybridScan2.c
correctSRCO= ${correctSRC:.c=.o}

	
testPerf.exe: ${perfSRCO}
	$(CXX) $(CXXFLAGS) -o testPerf.exe ${perfSRCO}
#	$(RM) ${seqVsParSRCO}

testHybridPerf.exe: ${perfHSRCO}
	$(CXX) $(CXXFLAGS) -o testHybridPerf.exe ${perfHSRCO}
#	$(RM) ${seqVsParSRCO}

testCorrectness.exe: ${correctSRCO}
	$(CXX) $(CXXFLAGS) -o testCorrectness.exe ${correctSRCO}
#	$(RM) ${correctSRCO}

testFinal.exe: ${SRCO}
	$(CXX) $(CXXFLAGS) -o testFinal.exe ${SRCO}
#	$(RM) ${SRCO}

clean:
	$(RM) *.o *.exe
	
%.o: %.c
	$(CXX) $(CXXFLAGS) -o $@ -c $<
